
using System;
using System.Collections.Generic;
using OnePiece.Ui.Controls.UI;

namespace OnePiece.Ui.Controls
{
    

    /// <summary>
    /// Class used by the HTML helpers to build HTML tags for message box.
    /// </summary>
    public class GridBuilder : ViewComponentBuilderBase<Grid, GridBuilder>, IHideObjectMembers
    {
        public GridBuilder(Grid component) : base(component)
        {
        }


        public virtual GridBuilder Url(string value)
        {
            Component.Url = value;
            return this;
        }

        public virtual GridBuilder DataType(DataSourceTypeEnum value)
        {
            Component.DataType = value;
            return this;
        }

        public virtual GridBuilder RequestType(RequestTypeEnum value)
        {
            Component.RequestType = value;
            return this;
        }

        public virtual GridBuilder ColumnModel(IList<ColumnModel> value)
        {
            Component.ColumnModel = value;
            return this;
        }
        public virtual GridBuilder PageSize(int value)
        {
            Component.PageSize = value;
            return this;
        }
        public virtual GridBuilder PageList(IList<int> value)
        {
            Component.PageList = value;
            return this;
        }
        public virtual GridBuilder SortName(string value)
        {
            Component.SortName = value;
            return this;
        }

        public virtual GridBuilder SortOrder(SortDirectionEnum value)
        {
            Component.SortDirection = value;
            return this;
        }
        public virtual GridBuilder ShowTotalItems(bool value)
        {
            Component.IsViewRecords = value;
            return this;
        }
        public virtual GridBuilder Caption(string value)
        {
            Component.Caption = value;
            return this;
        }
        public virtual GridBuilder Pager(string value)
        {
            Component.Pager = value;
            return this;
        }
        public virtual GridBuilder Width(int value)
        {
            Component.Width = value;
            return this;
        }
        public virtual GridBuilder Height(int value)
        {
            Component.Height = value;
            return this;
        }

        public virtual GridBuilder Navigator(GridNavigator value)
        {
            Component.Navigator = value;
            return this;
        }

        public virtual GridBuilder IsMultiBox(bool value)
        {
            Component.IsMultiBoxOnly = value;
            return this;
        }

        public virtual GridBuilder IsMultiSelect(bool value)
        {
            Component.IsMultipleSelect = value;
            return this;
        }
        public virtual GridBuilder IsAutoWidth(bool value)
        {
            Component.IsAutoWidth = value;
            return this;
        }

        public virtual GridBuilder IsShrinkToFit(bool value)
        {
            Component.IsShrinkToFit= value;
            return this;
        }

        public virtual GridBuilder IsLoadOnce(bool value)
        {
            Component.IsLoadOnce = value;
            return this;
        }



        public virtual GridBuilder Search(GridSearch value)
        {
            Component.Search = value;
            return this;
        }



        public virtual GridBuilder OnLoadError(Action javascript)
        {
            Component.OnLoadError = javascript;
            return this;
        }

   

        /// <summary>
        /// Specify the name of the theme apply to the message box.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <returns></returns>
        public virtual GridBuilder Theme(string name)
        {
            Component.Theme = name;

            return this;
        }
    }
}